package com.utils;

import com.creatobject.ResultObject;

public class ResultUtils {

    public static Result ok(){
        Result result = ResultObject.createResult();
        result.setCode(200);
        result.setMessage("成功");
       return  result;
    }

    public static Result ok(String message){
        Result result = ResultObject.createResult();
        result.setCode(200);
        result.setMessage(message);
        return  result;
    }

    public static Result ok(Object object){
        Result result = ResultObject.createResult();
        result.setCode(200);
        result.setMessage("查询成功");
        result.setData(object);
        return  result;
    }

    public static Result error(Integer code,String message){
        Result result = ResultObject.createResult();
        result.setCode(code);
        result.setMessage(message);
        result.setData(message);
        return  result;
    }
}
